package com.bootmy.dao.impl;

import com.bootmy.dao.DictDao;
import com.bootmy.model.Dict;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class DictDaoImpl implements DictDao{

    @Autowired
    private SqlSessionTemplate mySessionTemplate;
    //在这里用构造方法注入
    public DictDaoImpl(SqlSessionTemplate sqlSessionTemplate){
        this.mySessionTemplate = sqlSessionTemplate;
    }

    @Override
    public List<Dict> findAllUser() {

        return mySessionTemplate.selectList("Dict.findAllUser");
    }
}
